<template>
    <div class="group">
        <div class="header">
            <h2>{{title}}</h2>
        </div>
        <ul class="content">
            <li class="list" v-for="item in items" :key="item.id">
                <a href="">
                    <div class="group-info">
                        <img class="img" v-if="item.images.small" :src="item.images.small" alt="cover">
                        <span class="tit">{{item.title}}</span>                       
                        <span class="person" v-if="item.group_member">{{item.group_member}}人</span>
                    </div>
                    <div class="group-detail">
                        <span>{{item.group_topic.time}}</span>
                        <span>{{item.group_topic.title}}</span>
                    </div>
                </a>
            </li>
        </ul>
        <slot name="more"></slot>
    </div>
</template>

<script>
export default {
    name: 'Group',
    props: ['title', 'items'],
    data(){
        return {

        }
    }
}
</script>

<style lang="scss" scoped>
.group {
    margin-left: 1.8rem;
    padding-top: 1.4rem;

    .content {
        .list {
            overflow: hidden;
            border-bottom: 1px solid #f2f2f2;
            a {
                display: block;
                margin: 1.5rem 1.8rem 1.5rem 0;
            }
            .group-info {
                display: flex;
                align-items: center; 

                .tit {
                    flex: 1;
                    padding: 0 1rem;
                    font-size: 1.8rem;
                    color: #000;
                }
                .person {
                    color: #ccc;
                    font-size: 1.5rem;
                }
            }
            .group-detail {
                margin-top: 1rem;
                color: #ccc;
                font-size: 1.5rem;
                overflow: hidden;
                white-space: nowrap;
                text-overflow: ellipsis;
            }
        }
    }
    .list-link {
        display: block;
        color: #42bd56;
        font-size: 1.8rem;
        line-height: 1.8rem;
        padding: 1.5rem 0;
        text-align: center;
    }
}
</style>
